Readme for VB Shaped Form Creator (VBSFC) 11/2/99 ================================================= Update: ~~~~~~~~~~~~~~~ Version 6 released. This version includes a FormAnimator utility which can be used to produce animated shaped forms. Other features added: A "Preview" feature which shows the background image clipped to the current shape. This makes it easy t osee what the form will look like when it is generated. A "Copy as Bitmap" function which copies the current shape to the clipboard as a bitmap, ready to be pasted into an image editing app to produce a background image. Extra Save Formats: A binary Data File format. This contains just the shape information, and is therefore a smaller file than an entire generated form. Example code for reading data files is included, which should be a simple matter to translate into other programming languages (which support the Windows API calls) to produce shaped forms for them. A Delphi Form file format. This produces Delphi .pas and .dfm files which can be added to a delphi project. The delphi code produced by this feature can be considered Alpha test, as my Pascal skills are minimal to none. Format is Delphi 2, and subject to limitations: Cannot Modify Forms (sorry, I don't know enough Delphi format for this). Cannot display form or control positions when opening a form. Not really a problem, considering the above limitation. Does not perform any validation on form files opened. Is not TwipsPerPixel aware. I don't know how to do this without the Screen object in VB, or even whether it is a problem for Delphi. A "Scale" property looked intersting, though... It does, however, size the form correctly, make it borderless, and allow full window drag in the same way as as the VB generated forms. A C++ Source file format. This produces C++ .cpp and .h files which can be added to a C++ project to apply a shape to an existing window. It does not create a shaped window; it only produces the code which can then be used to apply a shape to a window. See the help file for a step by step guide on how to use the code to give a window a shape. Bug Fixes: If VBSFC is exited whilst in Edit Mode it will no longer start next time in Edit Mode. Switching to the Numerical Editor will now hide the Zoom Window. Possible bug when displaying the Tip Of The Day window identified, and workaround built in - a /NoTipWindow parameter switch has been added. Update 29/8/99: ~~~~~~~~~~~~~~~ Version 5.9 released. This version fixes another couple of bugs and adds a new Edge Tracer method. This is more of a shape-fill rather than an edge-trace, as it fills the bitmap with rectangles to build up the shape, rather than outlining it with polygons (Thanks to Chad for the idea). This may be less efficient, but if a particular bitmap is proving troublesome for the other two methods, then select this option. (Find it by pressing the "Options" button in the Edge Tracer window). Update 9/6/99: ~~~~~~~~~~~~~~ Version 5.8 released. This version adds a tip of the day, copy and pasting for shapes in the editor, and some minor bug fixes. Also includes command line parameters, mostly for debugging. If you are having trouble running VBSFC then try any combinations of the command line parameters /NoZoomWindow and /NoSubclassing. Update 20/2/99: ~~~~~~~~~~~~~~~ Version 5.6 released. This version adds a floating zoom window. It also allows you to drag and drop files onto the drawing area to open them. Update 11/2/99: ~~~~~~~~~~~~~~ Version 5.5 released. The major change for this version is the new interface, but apart from that there have been many other minor changes: Features Added: Shapes can be selected in the graphical editor by clicking on them. A Paste Background Bitmap command has been added. The Edge Tracer has a Clear Area command added. The Edge Tracer has also had a Paste Bitmap command added. The Edge Tracer is now a non-modal resizable minimizable whateverable window. An Add All button has been added to it. And the interface completely redone. When opening a form an outline of it, and all the controls on it, is displayed. If you try to save over an existing file it will ask you if you want to modify it instead. Warnings are given before any action that would cause you to loose the current shape if not saved. Improvements: The recently opened files history list no longer displays the full path, but a shortened path, with the full path appearing in the status bar when the mouse is over it. The grid runs about a million times faster (moved it into API drawing, rather than VB's incredibly slow line or point methods) When resizing the form, the shape is now repainted (if you opened a form larger than the window, it will now be displayed if you enlarge the window) What's This? help has been improved More settings are saved (I can't remember which, but I think pretty much everything gets saved now...) In the Graphical editor, it is now possible to drag one side of an object past its other side, as when drawing. When the right mouse button is clicked (in TwoClick mode, not for Polygons) the shape started is cancelled. When in ClickDrag mode, if a size 0 shape is drawn (a click rather than a drag), it is ignored. Bug Fixes: Trying to save or modify a form when there is nothing to save no longer produces an error. Cancelling a modify when prompted to replace exisiting information no longer produces an error when next opening a file. Reset All Settings twice no longer produces an error. Other stuff :) Probably anything that was wrong with it in previous versions isn't now, but if it is, let me know and I will fix it. Update 10/12/98: ~~~~~~~~~~~~~~~~ Version 4.0 released. This is the first version to be compiled under Visual Basic version 6. As such, it now requires the VB6 runtimes to run. The major change for this version is the addition of the Graphical Editor. This feature allows you to use the mouse to edit the shapes drawn, including adding, removing and moving polygon points. For more information, see the Graphical Editor section of the help file. Other changes include tooltips and What's This? help for all controls, an "Add All" command for the edge tracer (Shift+"Add"), and a couple of minor bug fixes. The code produced has also been modified. The forms are now resizable (handling the resizing manually), and the 64K limit VB imposes on functions is bypassed. For more details, see the Code Produced section of the help file. Please note, this is my first attempt with VB6, and although it has been in beta for a longer than usual time, to try and weed out all the bugs, it is always possible one slipped through. If you email a bug report to me at the address given at the end of this docmuent, I will fix it and see to it you are informed of the fix when it is done. Update 9/11/98: ~~~~~~~~~~~~~~~ Version 3.1 released. Fixes a bug with the file history list that could sometimes crash the program on exit. Corrects spelling of Transparent (was transparant) throughout program and documentation. Also adds command line handling, so files can be associated with it, or it can be placed on the send to menu, or have files dropped onto its executable, or shortcut to it. Also adds scaling to the forms created so that if the user has a different Screen.TwipsPerPixel setting (i.e. if they have 'Large Fonts' turned on, or something similar), the shaped form is scaled too. Please note that this will not automatically scale the background picture of a form (if any exists). If you wish to do this, may I suggest you use some lines of code in the form load procedure similar to: Me.Show Me.AutoRedraw = True Me.PaintPicture Me.Picture, 0, 0, Me.ScaleWidth, Me.ScaleHeight Me.AutoRedraw = False (This is taken from Reversi, the sample program provided on the website.) Update 31/10/98: ~~~~~~~~~~~~~~~~ Version 3.0 released. File New now clears background bitmap. Modifying a form which already contains region information does not now duplicate declarations (unless they have been modified by the user). A Recently Used Files list of the last 3 files opened or saved has been added to the File menu. There is new edge tracing algorithm (the old one is still available as an option). There is now an Auto try-again (optional) which searches for the best trace without requireing the user to press the Try Again button. There is now also Grid and Snap support. Update 24/9/98: ~~~~~~~~~~~~~~~ Version 2.3 released, with Undo/Redo support and VB5 form creation. Edge Tracer command has been moved to the "Tools" menu. Update 3/9/98: ~~~~~~~~~~~~~~ Version 2.2 released, with improved Edge Tracing algorithm, which includes "Try Again" button. Update 9/1/98: ~~~~~~~~~~~~~~ Version 2 released, with Edge Tracing command. See help file for details. Disclaimer: ~~~~~~~~~~~ This software is provided on an "as is" basis. Nothing should go wrong, but if it does, it is not my fault. You use this software at your own risk. License: ~~~~~~~~ This program is licensed for non-commercial use only. If you intend to sell your program, I think it is only fair you pay for mine (only 20$). See "Registration" in the help file for details on how to register online or by mail. Installation: ~~~~~~~~~~~~~ Ignore this section if you downloaded one of the installer programs. After you have downloaded VBSFC.zip, extract all the contents into the folder where you want it installed, for exampe "c:\program files\accessories \Visual Basic Shaped Form Creator\". There should be 4 files; this one (Readme.txt), the main executable (VB Shaped Form Creator.exe), the help file (VBSFC.hlp) and the help contents (VBSFC.cnt). This program requires the VB6 runtimes (vbrun60.exe) and the two common control ocx's ComCtl32.ocx and ComDlg32.ocx. If you are missing any of these files they can be downloaded from the my website at http://www.comports.com/AlexV/VBSFC.html Uninstallation: ~~~~~~~~~~~~~~~ If you have installed VBSFC using the installer, use the Add/Remove programs icon in the control panel, and select VB Shaped Form Creator. Otherwise, or if this item does not appear, then run VBSFC and choose "Remove All Settings" from the "Help" menu. This will remove all the programs registry entries. You can then delete all the files you installed. WalkThrough 10 step easyguide thingy. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This was requested, so I am putting it in. 90% of you won't need this, so don't bother reading it if you don't. 10 steps to a Shaped Hello World example ======================================== 1: Load VB Shaped form creator. 2: Draw your shape. For example, stick an oval so that it just touches the top and left of the drawing area. You can put it elsewhere if you want, but it is only wasting space. 3: Save it as a form. Put it somewhere you will remember. (optional step -- 3b: Export it as a bitmap. Put it in the same place as the form --) 4: Load VB. You should start with a blank project. 5: Remove the Form1 file (as we will not use it) 6: Add a file to the project. In VB4 this is done by right clicking on the project box and choosing "Add File". Select the form you saved in step 3. 7: Show the form (if not shown already) (optional step -- 7b: Set the form's "picture" property to the picture you exported in step 3b. This gives you a guideline as to what bits of the form are displayed when it is run. --) 8: Put a label control and a button contol on the form. Change the label caption to nothing, and the button caption to "Press Me" (or similar). If you have done the optional steps, then you can make sure that both controls are within the coloured area (red by default), then remove the form's picture (as we don't need it any more). 9: Double click the "Press Me" button to set code. Type into the sub the line: label1.caption = "Hello World" 10: Run the project. You will be told that you have not specified a startup form, and asked to do so. Specify the "ShapedForm" form, and run the project. Edge Tracer Issues: ~~~~~~~~~~~~~~~~~~~ The new algorithm (default) corrects some issues with the old one. The old algorithm was reported to produce a trace which would not cover the last line and row of pixels on the right and at the bottom, so for example an triangle with a 1 pixel wide outline would show the outline of only one side once traced. The new algorithm corrects this fault, but again, it is not perfect. With the new algorithm sometimes one or two background pixels find their way into being included in the traced area. This is not usually a problem, but I have included the old algorithm as an option just in case. ------------------------------------------------------------------------------ Thank you for reading this document. Email the author at: AlexV@ComPorts.com VB Shaped Form Creator website: www.ComPorts.com/AlexV/VBSFC.html Other programs by the same author: www.ComPorts.com/AlexV